
<!--<?php-->
<!--    require_once "util.php";-->
<!--    $util = new util();-->
<!--    -->
<!--    //重定向至home界面-->
<!--    if($util->openid_upload() == false){-->
<!--        $util->redirect_to_home();-->
<!--    }-->
<!--    //获取设备列表-->
<!--    $url="http://$util->server_ip/device/get_device?openid=$res";-->
<!--    $data = json_decode($util->httpGet($url));-->
<!--    -->
<!--    if($data->status == 1){-->
<!--        $dev_array = $data->data->list;-->
<!--    }-->
<!--?>-->

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <meta charset="UTF-8">
    <title>海闳电子科技</title>
<!--    <link rel="stylesheet" type="text/css" href="themes/css/core.css">-->
<!--    <link rel="stylesheet" type="text/css" href="themes/css/icon.css">-->
<!--    <link rel="stylesheet" type="text/css" href="themes/css/home.css">-->
<!--    <link rel="icon" type="image/x-icon" href="favicon.ico">-->
    <link rel="stylesheet" type="text/css" href="../../public/css/weui.css">
    <script src="../../public/layui/layui.all.js"></script>
    <link rel="stylesheet" type="text/css" href="../../public/layui/css/layui.css" media="all">
</head>


<body>
<ul class="layui-nav" lay-filter="">
    <li class="layui-nav-item layui-this"><a href="">首页</a></li>
    <li class="layui-nav-item"><a href="">添加设备</a></li>
    <li class="layui-nav-item"><a href="">其他</a></li>
</ul>
onload 加載
jquery 后端获取appid redirect_uri 拼接发送get请求.

https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa690edcf92ee8f2e&redirect_uri=http%3a%2f%2fphp.'+server_name+'%2fhome.php&response_type=code&scope=snsapi_userinfo&state=login#wechat_redirect'
<script type="text/javascript">
    function load() {
        alert("asdf");
    }
    window.onload = load;
</script>
<div class="weui-panel__hd">您当前未绑定设备,请进行绑定!</div>
<div class="weui-panel weui-panel_access">
    <a href="http://www.baidu.com" class="weui-media-box weui-media-box_appmsg">
        <div class="weui-media-box__hd">
            <img class="weui-media-box__thumb" src="../../public/html/button.png" alt="">
        </div>
        <div class="weui-media-box__bd">
        <h4 class="weui-media-box__title">device_name</h4>
        <p class="weui-media-box__desc">ABCDEFGHI</p>
        </div>
    </a>
</div>

<!--<?php-->
<!--$arrlength=count($dev_array);-->
<!--if ($arrlength == 0) {-->
<!--    echo '<div class="weui-panel__hd">您当前未绑定设备,请进行绑定!</div>';-->
<!--}else {-->
<!--    echo '<div class="weui-panel__hd">devicelist</div>';-->
<!--    for($x=0;$x<$arrlength;$x++){-->
<!--        $href="/device_info.php?id=".$dev_array[$x]->device_id;-->
<!--        $devname=$dev_array[$x]->device_name;-->
<!--        echo '<div class="weui-panel weui-panel_access">';-->
<!--        echo '<a href='.$href.' class="weui-media-box weui-media-box_appmsg">';-->
<!--        echo '<div class="weui-media-box__hd">';-->
<!--        echo '<img class="weui-media-box__thumb" src="http://ip/pic.png" alt="">';-->
<!--        echo '</div>';-->
<!--        echo '<div class="weui-media-box__bd">';-->
<!--        echo '<h4 class="weui-media-box__title">'.$devname.'</h4>';-->
<!--        echo '<p class="weui-media-box__desc">ABCDEFGHI</p>';-->
<!--        echo '</div>';-->
<!--        echo '</a>';-->
<!--        echo '</div>';-->
<!--    }-->
<!--}-->
<!--?>-->
</body>
</html>

